package com.rightsidetech.user.mapper;

import com.rightsidetech.user.dtos.response.UserAddressResp;
import com.rightsidetech.user.entity.UsUserAddress;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface UsUserAddressMapper {
    int deleteByPrimaryKey(Long id);

    int insert(UsUserAddress record);

    int insertSelective(UsUserAddress record);

    UsUserAddress selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(UsUserAddress record);

    int updateByPrimaryKey(UsUserAddress record);

    List<UserAddressResp> findByUserInfoId(@Param("userInfoId") Long userInfoId);

    UsUserAddress selectByusUserAddress(UsUserAddress address);

    int updateIsDefaultByUserInfoId(@Param("userInfoId") Long userInfoId, @Param("isDefault") Byte isDefault, @Param("id") Long id);

    int del(@Param("id") Long id, @Param("userInfoId") Long userInfoId);

    int updateIsDefault(@Param("id") Long id);

    UserAddressResp findDefaultByUserInfoId(@Param("userInfoId")Long userInfoId);

    UserAddressResp findByAddressIdAndUserInfoId(@Param("addressId")Long addressId, @Param("userInfoId")Long userInfoId);
}